from matplotlib import pyplot as plt
import pandas as pd
from collections import Counter

plt.style.use('fivethirtyeight')

data = pd.read_csv('bar_pie_data.csv')
language_counter = Counter()

for languages in data['LanguagesWorkedWith']:
    language_counter.update(languages.split(';'))
top5 = language_counter.most_common(8)

plt.pie([count for _, count in top5],
        labels=[name for name, _ in top5],
        explode=[0.1 if name == 'Python' else 0 for name, _ in top5],
        shadow=True,
        startangle=90,
        autopct='%1.1f%%',
        wedgeprops={'edgecolor': 'black'})

plt.title('My Awsome Pie Chart')
plt.tight_layout()
plt.show()


# Colors
# Blue = #008fd5
# Red = #fc4f30
# Yellow = #e5ae37
# Green = #6d904f
